//
//  CZIncomeDetailCell.m
//  TCProject
//
//  Created by admin on 16/2/1.
//  Copyright © 2016年 wise-wing. All rights reserved.
//

#import "CZIncomeDetailCell.h"
#import "ZDWalletLog.h"
#import "AccountManager.h"

@interface CZIncomeDetailCell()
@property (weak, nonatomic) IBOutlet UILabel *h1;//订单号
@property (weak, nonatomic) IBOutlet UILabel *h2;//方量
@property (weak, nonatomic) IBOutlet UILabel *v1;
@property (weak, nonatomic) IBOutlet UILabel *v2;
@property (weak, nonatomic) IBOutlet UILabel *v3;

@property (weak, nonatomic) IBOutlet UILabel *v4;

@end

@implementation CZIncomeDetailCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setLog:(ZDWalletLog *)log{
    _log =  log;
    
    
    _h1.text = [NSString stringWithFormat:@"服务时间: %@", _log.startTime];
    _v1.text = [NSString stringWithFormat:@"%@%1.f", [_log.pay isEqualToString:[AccountManager sharedInstance].user.ownId] ? @"-" : @"+",  _log.countMoney];
    _h2.text = [NSString stringWithFormat:@"方量: %.1f", _log.volume];
    _v2.text = [NSString stringWithFormat:@"+%.1f", _log.realsumPrice];
    ZDWalletLog *log1 = [_log.serviceLogs firstObject];
    ZDWalletLog *log2 = [_log.serviceLogs lastObject];
    _v3.text = [NSString stringWithFormat:@"+%.1f", log1.money];
    _v4.text = [NSString stringWithFormat:@"-%.1f", log2.money];

}
@end
